package com.demo.alibaba.util;

/**
 * Created by yangshunxing on 2017/3/7.
 */
public enum Area {
    BeiJing(110000,"北京市"),
    sichuan(510000,"四川省"),
    chongqing(500000,"重庆市"),
    TianJin(120000,"天津市"),
    ShanXi(140000,"山西省"),
    NeiMengGu(150000,"内蒙古"),
    LiaoNing(210000,"辽宁省"),
    JiangSu(320000,"江苏省"),
    ZheJiang(330000,"浙江省"),
    AnHui(340000,"安徽省"),
    FuJian(350000,"福建省"),
    ShanDong(370000,"山东省"),
    HuBei(420000,"湖北省"),
    HuNan(430000,"湖南省"),
    GuangDong(440000,"广东省"),
    GuiZhou(520000,"贵州省"),
    YunNan(530000,"云南省"),
    XinJiang(650000,"新疆");

    private Integer code;
    private String area;

    Area(Integer code, String area){
        this.code = code;
        this.area = area;
    }

    public static String getAreaByCode(Integer code){
          for (Area a:values()){
              if (a.code.equals(code)){
                  return a.area;
              }
          }
        return "未覆盖该区域";
    }
}
